package cn.itcast.travel.dao.impl;

import cn.itcast.travel.dao.RouteImgDao;
import cn.itcast.travel.domain.RouteImg;
import cn.itcast.travel.util.JDBCUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

/**
 * @Author CHAI
 * @Date 2022/5/2 9:20
 **/
public class RouteImgDaoImpl implements RouteImgDao {
    private JdbcTemplate template=new JdbcTemplate(JDBCUtils.getDataSource());

    @Override
    public List<RouteImg> findImg(int rid) {
        String sql="select * from tab_route_img where rid=?";
        List<RouteImg> query = template.query(sql, new BeanPropertyRowMapper<>(RouteImg.class), rid);


        return query;
    }
}
